package com.ccrfid.rmc6.repository.personnel;

import com.ccrfid.rmc6.entity.personnel.PersonnelTemperatureEntity;
import org.springframework.data.repository.Repository;

import java.sql.Timestamp;
import java.util.List;

public interface PersonnelTemperatureRepository extends Repository<PersonnelTemperatureEntity, Long> {

    PersonnelTemperatureEntity getTopByPersonnelIdOrderByIdDesc(Long personnelId);

    List<PersonnelTemperatureEntity> getAllByPersonnelIdAndRecordTimeBetweenOrderByIdAsc(Long personnelId, Timestamp start, Timestamp stop);

    List<PersonnelTemperatureEntity> getAllByCardNumberAndRecordTimeBetween(Long cardNumber, Timestamp start, Timestamp stop);

    PersonnelTemperatureEntity save(PersonnelTemperatureEntity entity);
}
